home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / totsrc.zip / TOTLOOK.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  9KB  |  363 lines

  1. {               Copyright 1991 TechnoJock Software, Inc.               }
  2. {                          All Rights Reserved                         }
  3. {                         Restricted by License                        }
  4.  
  5. {                             Build # 1.00                             }
  6.  
  7. Unit totLOOK;
  8. {$I TOTFLAGS.INC}
  9.  
  10. {
  11.  Development Notes:
  12.  
  13. }
  14.  
  15. INTERFACE
  16.  
  17. USES CRT, totSYS;
  18.  
  19. Type
  20.  
  21. pLookOBJ = ^LookOBJ;
  22. LookOBJ = object
  23.    vWinBorder: byte;
  24.    vWinBody: byte;
  25.    vWinTitle: byte;
  26.    vWinIcons: byte;
  27.    vWinMoveKey: word;
  28.    vWinStretchKey: word;
  29.    vWinZoomKey: word;
  30.    vMenuBorder: byte;
  31.    vMenuTitle: byte;
  32.    vMenuIcon: byte; 
  33.    vMenuHiHot: byte;                                               
  34.    vMenuHiNorm: byte;
  35.    vMenuLoHot: byte; 
  36.    vMenuLoNorm: byte;
  37.    vMenuInActive: byte;
  38.    vListEndKey: word;
  39.    vListEscKey: word;
  40.    vListToggleKey: word;
  41.    vListTagKey: word;
  42.    vListUntagKey: word;
  43.    vListLeftChar: char;
  44.    vListRightChar: char;
  45.    vListToggleOnChar: char;
  46.    vListToggleOffChar: char;
  47.    {methods...}
  48.    constructor Init;
  49.    procedure SetWindow(Border,Body,Icons,Title:byte);
  50.    procedure SetWinKeys(Move,Stretch,Zoom:word);
  51.    procedure SetListKeys(Endkey,Esc,Toggle,Tag,UnTag:word);
  52.    procedure SetListChars(LeftChar,RightChar,ToggleOnChar,ToggleOffChar: char);
  53.    procedure SetMenu(Bor,Tit,Icon,HiHot,HiNorm,LoHot,LoNorm,Off:byte);
  54.    procedure SetDefaults;
  55.    function  WinBorder: byte;
  56.    function  WinBody: byte;
  57.    function  WinTitle: byte;
  58.    function  WinIcons: byte;
  59.    function  WinMoveKey: word;
  60.    function  WinStretchKey: word;
  61.    function  WinZoomKey: word;
  62.    function  ListEndKey: word;
  63.    function  ListEscKey: word;
  64.    function  ListToggleKey: word;
  65.    function  ListTagKey: word;
  66.    function  ListUnTagKey: word;
  67.    function  ListLeftChar: char;
  68.    function  ListRightChar: char;
  69.    function  ListToggleOnChar: char;
  70.    function  ListToggleOffChar: char;
  71.    function  MenuBor: byte;
  72.    function  MenuTit: byte;
  73.    function  MenuIcon: byte;
  74.    function  MenuHiHot: byte;
  75.    function  MenuHiNorm: byte;
  76.    function  MenuLoHot: byte;
  77.    function  MenuLoNorm: byte;
  78.    function  MenuOff: byte;
  79.    destructor Done;
  80. end; {LookOBJ}
  81.  
  82. var
  83.   LookTOT:  ^LookOBJ;
  84.  
  85. procedure DING;
  86. procedure LOOKinit;
  87.  
  88. IMPLEMENTATION
  89.  
  90. procedure DING;
  91. begin
  92.    sound(2000);delay(100);nosound;
  93. end; {Ding}
  94. {|||||||||||||||||||||||||||||||||||||||}
  95. {                                       }
  96. {     L o o k O B J   M E T H O D S     }
  97. {                                       }
  98. {|||||||||||||||||||||||||||||||||||||||}
  99. constructor LookOBJ.Init;
  100. {}
  101. begin
  102.    SetDefaults;
  103. end; {LookOBJ.Init}
  104.  
  105. procedure LookOBJ.SetWindow(Border,Body,Icons,Title:byte);
  106. {}
  107. begin
  108.    vWinBorder := Border;
  109.    vWinBody := Body;
  110.    vWinIcons := Icons; 
  111.    vWinTitle := Title; 
  112. end; {LookOBJ.SetWarning}
  113.  
  114. procedure LookOBJ.SetWinKeys(Move,Stretch,Zoom:word);
  115. {}
  116. begin
  117.    vWinMoveKey   := Move;
  118.    vWinStretchKey:= Stretch;
  119.    vWinZoomKey   := Zoom;
  120. end; {LookOBJ.SetWinKeys}
  121.  
  122. procedure LookOBJ.SetListKeys(Endkey,Esc,Toggle,Tag,UnTag:word);
  123. {}
  124. begin
  125.    vListEndKey   := Endkey;
  126.    vListEscKey   := Esc;
  127.    vListToggleKey:= Toggle;
  128.    vListTagKey   := Tag;
  129.    vListUnTagKey := UnTag;
  130. end; {LookOBJ.SetListKeys}
  131.  
  132. procedure LookOBJ.SetListChars(LeftChar,RightChar,ToggleOnChar, ToggleOffChar: char);
  133. {}
  134. begin
  135.    vListLeftChar   := LeftChar;
  136.    vListRightChar  := RightChar;
  137.    vListToggleOnChar := ToggleOnChar;
  138.    vListToggleOffChar := ToggleOffChar;
  139. end; {LookOBJ.SetListChars}
  140.  
  141. procedure LookOBJ.SetMenu(Bor,Tit,Icon,HiHot,HiNorm,LoHot,LoNorm,Off:byte);
  142. {}
  143. begin
  144.    vMenuBorder := Bor;
  145.    vMenuTitle := Tit; 
  146.    vMenuIcon := Icon; 
  147.    vMenuHiHot := HiHot; 
  148.    vMenuHiNorm := HiNorm;
  149.    vMenuLoHot := LoHot; 
  150.    vMenuLoNorm :=  LoNorm;
  151.    vMenuInActive := Off;
  152. end; {of proc LookOBJ.SetMenu}
  153.  
  154. procedure LookOBJ.SetDefaults;
  155. {}
  156. begin
  157.    if Monitor^.ColorOn then {color System}
  158.    begin
  159.       vWinBorder := 76;       {lightred on red}
  160.       vWinBody := 79;         {white on red}
  161.       vWinIcons := 67;        {lightcyan on red}
  162.       vWinTitle := 78;        {yellow on red}
  163.       vMenuBorder := 23;      {lightgray on blue}
  164.       vMenuTitle := 30;       {yellow on blue}  
  165.       vMenuIcon := 27;       {lightcyan on blue} 
  166.       vMenuHiHot := 78;       {yellow on red}
  167.       vMenuHiNorm := 79;      {white on red}
  168.       vMenuLoHot := 30;       {yellow on blue} 
  169.       vMenuLoNorm := 31;      {white on blue}
  170.       vMenuInActive := 23;    {lightgray on blue}
  171.       SetListChars(#0,#0,chr(251),' ');
  172.    end
  173.    else                    {monochrome}
  174.    begin
  175.       vWinBorder := 112;      {black on lightgray}
  176.       vWinBody := 112;
  177.       vWinIcons := 112;
  178.       vWinTitle := 112;
  179.       vMenuBorder := 112;     
  180.       vMenuTitle := 112;
  181.       vMenuIcon := 112;
  182.       vMenuHiHot := 7;        {lightgray on black}
  183.       vMenuHiNorm := 15;      {white on black}
  184.       vMenuLoHot := 15;       {white on black}
  185.       vMenuLoNorm := 112;     {black on lightgray}
  186.       vMenuInActive := 8;     {darkgray on black}
  187.       SetListChars(Chr(16),chr(17),chr(251),' ');
  188.    end;
  189.    vWinMoveKey   := 354;      {Ctrl-F5}
  190.    vWinStretchKey:= 364;      {Alt-F5}
  191.    vWinZoomKey   := 319;      {F5}
  192.    vListEndKey   := 324;      {F10}
  193.    vListEscKey   := 27;       {Esc}
  194.    vListToggleKey:= 32;       {space bar}
  195.    vListTagKey   := 276;      {Alt-T}
  196.    vListUnTagKey := 278;      {Alt-U}
  197. end; {LookOBJ.SetDefaults}
  198.  
  199. function LookOBJ.WinBorder: byte;
  200. {}
  201. begin
  202.    WinBorder := vWinBorder;
  203. end; {of func LookOBJ.WinBorder}
  204.  
  205. function LookOBJ.WinBody: byte;
  206. {}
  207. begin
  208.    WinBody := vWinBody;
  209. end; {of func LookOBJ.WinBody}
  210.  
  211. function LookOBJ.WinIcons: byte;
  212. {}
  213. begin
  214.    WinIcons := vWinIcons;
  215. end; {of func LookOBJ.WinIcons}
  216.  
  217. function LookOBJ.WinTitle: byte;
  218. {}
  219. begin
  220.    WinTitle := vWinTitle;
  221. end; {LookOBJ.WinTitle}
  222.  
  223. function LookOBJ.WinMoveKey: word;
  224. {}
  225. begin
  226.    WinMoveKey := vWinMoveKey;
  227. end; {LookOBJ.WinMoveKey}
  228.  
  229. function LookOBJ.WinStretchKey: word;
  230. {}
  231. begin
  232.    WinStretchKey := vWinStretchKey;
  233. end; {LookOBJ.WinStretchKey}
  234.  
  235. function LookOBJ.WinZoomKey: word;
  236. {}
  237. begin
  238.    WinZoomKey := vWinZoomKey;
  239. end; {LookOBJ.WinZoomKey}
  240.  
  241. function LookOBJ.ListEndKey: word;
  242. {}
  243. begin
  244.    ListEndKey := vListEndKey;
  245. end; {LookOBJ.ListEndKey}
  246.  
  247. function LookOBJ.ListEscKey: word;
  248. {}
  249. begin
  250.    ListEscKey := vListEscKey;
  251. end; {LookOBJ.ListEscKey}
  252.  
  253. function LookOBJ.ListToggleKey: word;
  254. {}
  255. begin
  256.    ListToggleKey := vListToggleKey;
  257. end; {LookOBJ.ListToggleKey}
  258.  
  259. function LookOBJ.ListTagKey: word;
  260. {}
  261. begin
  262.    ListTagKey := vListTagKey;
  263. end; {LookOBJ.ListTagKey}
  264.  
  265. function LookOBJ.ListUnTagKey: word;
  266. {}
  267. begin
  268.    ListUnTagKey := vListUnTagKey;
  269. end; {LookOBJ.ListUnTagKey}
  270.  
  271. function LookOBJ.ListLeftChar: char;
  272. {}
  273. begin
  274.    ListLeftChar := vListLeftChar;
  275. end; {LookOBJ.ListLeftChar}
  276.  
  277. function LookOBJ.ListRightChar: char;
  278. {}
  279. begin
  280.    ListRightChar := vListRightChar;
  281. end; {LookOBJ.ListRightChar}
  282.  
  283. function LookOBJ.ListToggleOnChar: char;
  284. {}
  285. begin
  286.    ListToggleOnChar := vListToggleOnChar;
  287. end; {LookOBJ.ListToggleOnChar}
  288.  
  289. function LookOBJ.ListToggleOffChar: char;
  290. {}
  291. begin
  292.    ListToggleOffChar := vListToggleOffChar;
  293. end; {LookOBJ.ListToggleOffChar}
  294.  
  295. function LookOBJ.MenuBor: byte;
  296. {}
  297. begin
  298.    MenuBor := vMenuBorder;
  299. end; {of func LookOBJ.MenuBor}
  300.  
  301. function LookOBJ.MenuTit: byte;
  302. {}
  303. begin
  304.    MenuTit := vMenuTitle;
  305. end; {of func LookOBJ.MenuTit}
  306.  
  307. function LookOBJ.MenuIcon: byte;
  308. {}
  309. begin
  310.    MenuIcon := vMenuIcon;
  311. end; {of func LookOBJ.MenuIcon}
  312.  
  313. function LookOBJ.MenuHiHot: byte;
  314. {}
  315. begin
  316.    MenuHiHot := vMenuHiHot;
  317. end; {of func LookOBJ.MenuHiHot}
  318.  
  319. function LookOBJ.MenuHiNorm: byte;
  320. {}
  321. begin
  322.    MenuHiNorm := vMenuHiNorm;
  323. end; {of func LookOBJ.MenuHiNorm}
  324.  
  325. function LookOBJ.MenuLoHot: byte;
  326. {}
  327. begin
  328.    MenuLoHot := vMenuLoHot;
  329. end; {of func LookOBJ.MenuLoHot}
  330.  
  331. function LookOBJ.MenuLoNorm: byte;
  332. {}
  333. begin
  334.    MenuLoNorm := vMenuLoNorm;
  335. end; {of func LookOBJ.MenuLoNorm}
  336.  
  337. function LookOBJ.MenuOff: byte;
  338. {}
  339. begin
  340.    MenuOff := vMenuInActive;
  341. end; {of func LookOBJ.MenuOff}
  342.  
  343. destructor LookOBJ.Done;
  344. begin end;
  345. {|||||||||||||||||||||||||||||||||||||||||||||||}
  346. {                                               }
  347. {     U N I T   I N I T I A L I Z A T I O N     }
  348. {                                               }
  349. {|||||||||||||||||||||||||||||||||||||||||||||||}
  350. procedure LookInit;
  351. {initilizes objects and global variables}
  352. begin
  353.    new(LookTOT,Init);
  354. end; {procedure LookInit}
  355.  
  356. {end of unit - add intialization routines below}
  357. {$IFNDEF OVERLAY}
  358. begin
  359.    LookInit;
  360. {$ENDIF}
  361. end.
  362.  
  363.